package dao

import (
	"blog/entity"
	"blog/utils"
)

/*
初始化方法，获取数据库驱动
*/
func init() {
	db = utils.GetMysql()
}

/*
用户登录
*/
func Login(username string, password string) entity.User {
	var user entity.User
	db.Debug().Where("username = ?", username).Where("password = ?", password).First(&user)
	return user
}
